package com.wf.demo.job.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.wf.demo.info.pojo.Company;
import lombok.Data;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @Auther: wf
 * @Date: 2019/12/11 21:12
 * @Description:  每当公司的设备数量发生变化时，则生成此
 */
@Data
@Entity
@Table(name = "deviceNumberChangeOfCompany")
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
public class DeviceNumberChangeOfCompany {
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private  int id;
    //发生变化的时间
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime creatTime;
    //这个月设备数量的变化情况，如果是负值表示减少了，初始值为0
    private  int numberChangeDevice;
    private String csNumber;

    @ManyToOne
    @JoinColumn(name = "cid")
    private Company company;
}
